/**
 * Created by CZ on 2017/5/3.
 */
module.exports = function ($scope,$rootScope,$localStorage,RequestService,$state,commonConfig) {
    $rootScope.isShowFooter = false;
    // 设置轮播图图片间隔
    $scope.myInterval = 5000;

    // 轮播图数据初始化
    var slides = $scope.slides = [];
    // 添加轮播图源
    slides.push({ image: 'src/imgs/App/App-banner1.png', text: '' });
    // slides.push({ image: 'src/imgs/banner2.png', text: '' });
    //获取应用列表
    // status 是否审批通过  isOpen 是否上架
    RequestService.Request(commonConfig.cloudApi+'cloud/app?orderBy=id&isOpen=1&status=1&pageSize=10000000','GET').then(function(res){
        console.log(res);
        $scope.AppsList = res.list;
    },function(error){
        console.log(error);
    });

    //星星等级评分
    $scope.max = 5;
    $scope.ratingVal = 0;
    $scope.hoverVal = 0;//一般的话，ratingVal和hoverVal都写0就可以了。
    // $scope.readonly = false; 控制是否只是显示不控制
    $scope.onHover = function(val) {
        $scope.hoverVal = val;
    };
    $scope.onLeave = function() {
        $scope.hoverVal = $scope.ratingVal;
    };
    $scope.onChange = function(val) {
        $scope.ratingVal = val;
    };
    
    $scope.goAppDetail = function(appId){
        $state.go('CloudPlatform.App.Detail',{'id':appId});
    }

};